import httpInstance from "@/utils/http";

//轮播图首页跟分类页的逻辑相似
/* 原本的代码:
export function getBannerAPI( ){
   return httpInstance({
        url: '/home/banner'
    })
} */
export function getBannerAPI(params ={}) {
  //不传就是1 传了就是2
   const { distributionSite = '1' } = params
   return httpInstance({
     url: '/home/banner',
     params: { distributionSite }  // 添加参数
    })
}

export const findNewAPI = () => {
  return  httpInstance('home/new')
}
/**
 * @description: 获取人气推荐
 * @param {*}
 * @return {*}
 */
export const getHotAPI = () => {
  return  httpInstance('home/hot')
}

/**
 * @description: 获取所有商品模块
 * @param {*}
 * @return {*}
 */
export const getGoodsAPI = () => {
  return httpInstance({
    url: '/home/goods'
  })
}